﻿using Masa.BuildingBlocks.Ddd.Domain.Repositories;
using Masa.CqrsProject.Models;

namespace Masa.CqrsProject.Repositorys
{

    /// <summary>
    /// 订单仓储（操作订单聚合根写入到数据库）
    /// </summary>
    public interface IOrderRepository :IRepository<OrderInfo,int>, IScopedDependency
    {

        /// <summary>
        /// 创建订单
        /// </summary>
        /// <param name="orderInfo"></param>
        /// <returns></returns>
        Task CreateAsync(OrderInfo orderInfo);

        /// <summary>
        /// 更新订单
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        Task UpdateAsync(OrderInfo model);

        /// <summary>
        /// 查询订单
        /// </summary>
        /// <param name="orderSn"></param>
        /// <returns></returns>
        Task<OrderInfo> GetOrderAsync(string orderSn);

        /// <summary>
        /// 查询订单列表
        /// </summary>
        /// <returns></returns>
        Task<List<OrderInfo>> GetOrderListAsync(string whereStr);

        /// <summary>
        /// 删除订单
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task DeleteAsync(int id);


    }
}
